package net.hxz.modules.services.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.hxz.modules.dao.ColumnMapper;
import net.hxz.modules.pojo.Column;
import net.hxz.modules.services.IColumnService;
import net.wy.modules.bean.ListCondition;

@Service("columnService")
public class ColumnService implements IColumnService {

	@Autowired
	private ColumnMapper columnMapper;
	
	public List<Column> getByParentId(int parentId) {
		return columnMapper.getByParentId(parentId);
	}
	
	public int getColumnCountByParentId(long parentId){
        ListCondition listCondition = new ListCondition();
        listCondition.getListSql().add(" and id>0");
        listCondition.getListSql().add(" and parentId="+parentId);
        return columnMapper.count(listCondition);
    }
	
	public List<Column> getByIds(int[] ids){
		return columnMapper.getByIds(ids);
	}

}
